home *** CD-ROM | disk | FTP | other *** search
- Path: news.ahc.ameritech.com!datalytics!usenet
- From: Rob Stewart <stew@datalytics.com>
- Newsgroups: comp.lang.c++
- Subject: Re: HELP:: Naming Conventions
- Date: Wed, 20 Mar 1996 12:16:55 -0500
- Organization: Datalytics, Inc
- Message-ID: <31503D87.4D62@datalytics.com>
- References: <4in6gn$p2t@info.eng.octel.com> <4io6n5$n9v@sam.inforamp.net>
- NNTP-Posting-Host: 204.62.224.71
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Randy Charles Morin wrote:
- >
- > In article <4in6gn$p2t@info.eng.octel.com>, wdengel@ibm.net (Wayne) wrote:
- > >class MyObject
- > >..
- > >MyObject m_MyInstance; OK
- > >MyObject *pm_MyInstance; OK
- > >but what about
- > >MyObject *???_MyInstance[SomeNum] What is the convention???
- >
- > MyObject am_MyInstance;
- > or...
- > MyObject m_aMyInstance;
- >
- > I've always used a to denote an array.
- >
- > Agrivar
- >
-
- We use "v" to denote vector. This is a more general term and
- applies equally well to user-defined vector types (classes).
-
- I assume the "m_" in your examples denotes data members? If
- that's the case, may I recommend that the "m_" always start the
- identifier? In other words, your "pm_MyInstance" should be
- "m_pMyInstance." This keeps the usage prefix ("p" in this case)
- with the identifier as it would be for non-members
- ("pAnInstance") and ensures that the "m_" is visible.
-
- We don't subscribe to the whole Hungarian notation mess,
- however. We only use the following usage prefixes:
-
- b boolean value (the type may int, bool, etc.)
- p pointer to something
- h handle to something (this may be UNIX's int file
- handle, Win32's HANDLE, etc.)
- v vector (array) of something
-
- I do make use of certain other more complex type prefixes as
- shown here:
-
- cs critical section (a Win32 thread synchronization
- construct)
- mtx mutex
- sem semaphore
-
- --
- Robert Stewart | My opinions are usually my own.
- Datalytics, Inc. | stew@datalytics.com
-